<template>
  <view class="page">
    <u-navbar @leftClick="navLeftClick" :fixed="false" title="企业介绍" placeholder bgColor="#fff"></u-navbar>
    <view class="user-info" :style="'background-image: url('+userBg+');'">
      <view class="u-flex u-m-b-16">
        <image style="width: 100rpx;height: 100rpx;margin-right: 26rpx;" :src="form.avatar" mode="aspectFill" />
        <view>
          <view class="u-font-28 u-m-b-8">{{ form.nickName }}</view>
          <view class="u-font-24">{{ form.phonenumber }}</view>
        </view>
      </view>
      <view class="u-font-28 u-m-b-12" id="companyName" @click="copy('companyName')">{{ form.companyName }}</view>
      <view class="u-font-28 u-m-b-12" id="slogan" @click="copy('slogan')" style="font-weight: 500;">{{ form.slogan }}</view>
      <view class="u-font-24" id="companyAddress" @click="copy('companyAddress')" style="color: #818181;">地址：{{ form.companyAddress }}</view>
    </view>
    <view class="ql-editor" id="introduction" v-html="form.introduction"></view>
    <view class="p-wxcode" v-if="wechatQrCode" @click="showDetail=true">
      <image src="../../static/my/wxcode.png" />
    </view>
    <u-popup :show="showDetail" :round="20" mode="center" @close="showDetail=false" :safeAreaInsetBottom="false">
      <view style="padding: 40rpx;">
        <image style="width: 420rpx;height: 573rpx;" :src="wechatQrCode" />
      </view>
		</u-popup>
  </view>
</template>

<script>
import "@vueup/vue-quill/dist/vue-quill.snow.css"
import userBg from '../../static/my/materialCenterUser.png'
import { getCompanyInfo } from '@/api/index'


export default {
	data() {
		return {
      showDetail: false,
      userBg,
      form: {},
      wechatQrCode: "",
		};
	},
	async onLoad(options) {
    if(options.wechatQrCode) {
      this.wechatQrCode = options.wechatQrCode
    }
    getCompanyInfo({ deptId: uni.getStorageSync('userInfo').deptId, }).then(res => {
      this.form = res.data || {}
    })
	},
	methods: {
	},
};
</script>

<style lang="scss" scoped>
.page {
	width: 750rpx;
	min-height: 100vh;
	background-color: #f5f5f5;
	padding-bottom: 80rpx;
	position: relative;
}
.user-info {
  width: 702rpx;
  height: 306rpx;
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: 702rpx 306rpx;
  margin: 0 auto 12rpx;
  border-radius: 12rpx;
  padding: 24rpx;
}
.share-btn {
  width: 80rpx;
  height: 80rpx;
  position: fixed;
  right: 12rpx;
  bottom: 42rpx;
  image {
    width: 80rpx;
    height: 80rpx;
  }
}
</style>

